 <?php require_once ADMINVIEWPATH.'admin_header.php'; ?>
<?php require_once ADMINVIEWPATH.'admin_menu.php'; ?>
 <link href="<?= STATICURL; ?>css/bootstrap.min.css" rel="stylesheet" />
    <link id="bootstrap-rtl-link" href="" rel="stylesheet" />
    <link href="<?= STATICURL; ?>css/font-awesome.min.css" rel="stylesheet" />
    <link href="<?= STATICURL; ?>css/weather-icons.min.css" rel="stylesheet" />
    <!--Fonts-->
    <!--Beyond styles-->
    <link id="beyond-link" href="<?= STATICURL; ?>css/beyond.min.css" rel="stylesheet" type="text/css" />
    <link href="<?= STATICURL; ?>css/demo.min.css" rel="stylesheet" />
    <link href="<?= STATICURL; ?>css/typicons.min.css" rel="stylesheet" />
    <link href="<?= STATICURL; ?>css/animate.min.css" rel="stylesheet" />
    <link id="skin-link" href="" rel="stylesheet" type="text/css" />
    <div class="page-content">
         <!-- Page Breadcrumb -->
                <div class="page-breadcrumbs">
                    <ul class="breadcrumb">
                        <li>
                            <i class="fa fa-home"></i>
                            <a href="#">首页</a>
                        </li>
                        <li class="">
                            <a href="index">公告信息</a>
                        </li>
                    </ul>
                </div>
        <div class="page-body">
            <div >
                <div id="horizontal-form">
                    <form class="form-horizontal" role="form">
                        <div class="row">
                            <div class="col-md-12">
                                <input class="form-control it_title" value="<?php echo $broadcastInfo['title']?>" type="text" placeholder="标题">
                                <div class="horizontal-space"></div>
                            </div>
                        </div>
                        <textarea class="form-control contents" rows="3" id="contents" name="contents" placeholder="Content" style="height:300px;">
                            <?=$broadcastInfo['content']?>
                        </textarea>
                        <div class="horizontal-space"></div>
                        <div>
                            <span id="editBroadcast" class="btn btn-default">提交</span>
                        </div>
                    </form>
                </div>
            </div>
        </div>
        <input type="hidden" id="idpalce" value="<?php echo $broadcastInfo['id']?>" />
<script src="<?= STATICURL; ?>kindeditor/kindeditor.js"></script>
<?php require_once ADMINVIEWPATH.'admin_footer.php'; ?>

<script>
KindEditor.ready(function(K) {
    window.editor = K.create('#contents');
});
    $(document).ready(function() {
        $("#editBroadcast").click(function(){
            editor.sync();//Js获取值时前面添加
            var contents = $(".contents").val();
            var title = $(".it_title").val();
            var id = $("#idpalce").val();
            if(contents == ""){
                layer.msg("内容不能为空");return false;
            }
            
            $.post("editBroadcast", {"contents":contents,"id":id,title:title}, function(res) {
                if (res) {
                    layer.msg("成功");
                    window.location.href="/luckydog/broadcast/index";
                }else{
                    layer.msg("失败");
                }
            });
        });
    });
</script>


